package com.dm.cloud.basepo.po;

import com.dm.cloud.basepo.service.SnowflakeGenId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import java.util.Date;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class BasePo {

    /**
     * 数据库物理唯一标识
     */
    @Id
    @KeySql(genId = SnowflakeGenId.class)
    @Column(name = "id")
    private String id;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "create_user")
    private String createUser;

    @Column(name = "update_time")
//    @Version(nextVersion = DefaultNextVersion.class)
    private Date updateTime;

    @Column(name = "update_user")
    private String updateUser;

}
